//回顾：
//定义一个字符串数组，输入一个字符串,从数组中删除,删除后,后面的往前移动,注意置空的处理...
//比如字符串为{"aa","bb","cc","ff"},如果bb被删除后,则为{"aa","cc","ff",null}
public class Return {
    public static void main(String[] args) {
        String[] arr = {"aa", "bb", "cc", "ff"};
        Scanner in = new Scanner(System.in);
        System.out.println("input data you want delete:");
        String data = in.next();
        int i = 0;
        for (; i < arr.length; i++) {
            if (data.equals(arr[i])) {
                for (int j = i; j < arr.length - 1; j++) {
                    arr[j] = arr[j + 1];
                }
                arr[arr.length - 1] = null;
                break;
            } else continue;
        }
        if (i == arr.length) {
            System.out.println("can not find");
        }
        System.out.println(Arrays.toString(arr));
    }
}